/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controlepgto.beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Thiago
 */
@Entity
@Table(name = "contato", catalog = "controlepgto", schema = "")
@NamedQueries({
    @NamedQuery(name = "Contato.findAll", query = "SELECT c FROM Contato c"),
    @NamedQuery(name = "Contato.findByIdContato", query = "SELECT c FROM Contato c WHERE c.idContato = :idContato"),
    @NamedQuery(name = "Contato.findByPessoaContato", query = "SELECT c FROM Contato c WHERE c.pessoaContato = :pessoaContato"),
    @NamedQuery(name = "Contato.findByTelComercialContato", query = "SELECT c FROM Contato c WHERE c.telComercialContato = :telComercialContato"),
    @NamedQuery(name = "Contato.findByTelCelContato", query = "SELECT c FROM Contato c WHERE c.telCelContato = :telCelContato"),
    @NamedQuery(name = "Contato.findByTelResiContato", query = "SELECT c FROM Contato c WHERE c.telResiContato = :telResiContato"),
    @NamedQuery(name = "Contato.findByEmail", query = "SELECT c FROM Contato c WHERE c.email = :email"),
    @NamedQuery(name = "Contato.findBySite", query = "SELECT c FROM Contato c WHERE c.site = :site"),
    @NamedQuery(name = "Contato.findByFacebook", query = "SELECT c FROM Contato c WHERE c.facebook = :facebook"),
    @NamedQuery(name = "Contato.findByOutros", query = "SELECT c FROM Contato c WHERE c.outros = :outros")})
public class Contato implements Serializable {

    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Contato", nullable = false)
    private Integer idContato;
    @Column(name = "pessoa_Contato", length = 100)
    private String pessoaContato;
    @Column(name = "tel_Comercial_Contato", length = 20)
    private String telComercialContato;
    @Column(name = "tel_Cel_Contato", length = 20)
    private String telCelContato;
    @Column(name = "tel_Resi_Contato", length = 20)
    private String telResiContato;
    @Column(length = 100)
    private String email;
    @Column(length = 100)
    private String site;
    @Column(length = 45)
    private String facebook;
    @Column(length = 45)
    private String outros;
    

    public Contato() {
    }

    public Contato(Integer idContato) {
        this.idContato = idContato;
    }

    public Integer getIdContato() {
        return idContato;
    }

    public void setIdContato(Integer idContato) {
        Integer oldidContato = this.idContato;
        this.idContato = idContato;
        changeSupport.firePropertyChange("idContato", oldidContato, idContato);
    }

    public String getPessoaContato() {
        return pessoaContato;
    }

    public void setPessoaContato(String pessoaContato) {
        String oldpessoaContato = this.pessoaContato;
        this.pessoaContato = pessoaContato;
        changeSupport.firePropertyChange("pessoaContato", oldpessoaContato, pessoaContato);
    }

    public String getTelComercialContato() {
        return telComercialContato;
    }

    public void setTelComercialContato(String telComercialContato) {
        String oldtelComercialContato = this.telComercialContato;
        this.telComercialContato = telComercialContato;
        changeSupport.firePropertyChange("telComercialContato", oldtelComercialContato, telComercialContato);
    }

    public String getTelCelContato() {
        return telCelContato;
    }

    public void setTelCelContato(String telCelContato) {
        String oldtelCelContato = this.telCelContato;
        this.telCelContato = telCelContato;
        changeSupport.firePropertyChange("telCelContato", oldtelCelContato, telCelContato);
    }

    public String getTelResiContato() {
        return telResiContato;
    }

    public void setTelResiContato(String telResiContato) {
        String oldtelResiContato = this.telResiContato;
        this.telResiContato = telResiContato;
        changeSupport.firePropertyChange("telResiContato", oldtelResiContato, telResiContato);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        String oldemail = this.email;
        this.email = email;
        changeSupport.firePropertyChange("email", oldemail, email);
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        String oldsite = this.site;
        this.site = site;
        changeSupport.firePropertyChange("site", oldsite, site);
    }

    public String getFacebook() {
        return facebook;
    }

    public void setFacebook(String facebook) {
        String oldfacebook = this.facebook;
        this.facebook = facebook;
        changeSupport.firePropertyChange("facebook", oldfacebook, facebook);
    }

    public String getOutros() {
        return outros;
    }

    public void setOutros(String outros) {
        String oldoutros = this.outros;
        this.outros = outros;
        changeSupport.firePropertyChange("outros", oldoutros, outros);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idContato != null ? idContato.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contato)) {
            return false;
        }
        Contato other = (Contato) object;
        if ((this.idContato == null && other.idContato != null) || (this.idContato != null && !this.idContato.equals(other.idContato))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "controlepgto.beans.Contato[ idContato=" + idContato + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

   
}
